package com.blensmile.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.EditText;
import android.widget.TextView;

import com.blensmile.BaseActivity;
import com.blensmile.R;

public class InputTestActivity extends BaseActivity {

    private EditText etText;
    private TextView tvText;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_input_test);

        etText = (EditText)findViewById(R.id.et_text);
        tvText = (TextView)findViewById(R.id.tv_text);
        etText.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent intent = new Intent(InputTestActivity.this,InputTestActivity.class);
                startActivity(intent);
            }
        });
    }

    @Override
    protected void onResume() {
        super.onResume();
        try {
            etText.performClick();
            etText.requestFocus();
            InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE);
            imm.showSoftInput(etText, 0);
        }catch (Exception e){}
    }
}
